home *** CD-ROM | disk | FTP | other *** search
/ Oh!X 2000 Spring / Oh!X 2000 Spring Special CD-ROM (Japan) (Part 2).7z / Oh!X 2000 Spring Special CD-ROM (Japan) (Part 2).bin / DXF / include / dplobby.h < prev    next >
C/C++ Source or Header  |  1999-09-08  |  29KB  |  821 lines

  1. /*==========================================================================;
  2.  *
  3.  *  Copyright (C) 1996-1997 Microsoft Corporation.  All Rights Reserved.
  4.  *
  5.  *  File:       dplobby.h
  6.  *  Content:    DirectPlayLobby include file
  7.  ***************************************************************************/
  8. #ifndef __DPLOBBY_INCLUDED__
  9. #define __DPLOBBY_INCLUDED__
  10.  
  11. #include "dplay.h"
  12.  
  13. /* avoid warnings at Level 4 */
  14. #pragma warning(disable:4201)
  15.  
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif /* __cplusplus */
  19.  
  20. /*
  21.  * GUIDS used by DirectPlay objects
  22.  */
  23.  
  24. /* {AF465C71-9588-11cf-A020-00AA006157AC} */
  25. DEFINE_GUID(IID_IDirectPlayLobby, 0xaf465c71, 0x9588, 0x11cf, 0xa0, 0x20, 0x0, 0xaa, 0x0, 0x61, 0x57, 0xac);
  26. /* {26C66A70-B367-11cf-A024-00AA006157AC} */
  27. DEFINE_GUID(IID_IDirectPlayLobbyA, 0x26c66a70, 0xb367, 0x11cf, 0xa0, 0x24, 0x0, 0xaa, 0x0, 0x61, 0x57, 0xac);
  28. /* {0194C220-A303-11d0-9C4F-00A0C905425E} */
  29. DEFINE_GUID(IID_IDirectPlayLobby2, 0x194c220, 0xa303, 0x11d0, 0x9c, 0x4f, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
  30. /* {1BB4AF80-A303-11d0-9C4F-00A0C905425E} */
  31. DEFINE_GUID(IID_IDirectPlayLobby2A, 0x1bb4af80, 0xa303, 0x11d0, 0x9c, 0x4f, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
  32. /* {2DB72490-652C-11d1-A7A8-0000F803ABFC} */
  33. DEFINE_GUID(IID_IDirectPlayLobby3, 0x2db72490, 0x652c, 0x11d1, 0xa7, 0xa8, 0x0, 0x0, 0xf8, 0x3, 0xab, 0xfc);
  34. /* {2DB72491-652C-11d1-A7A8-0000F803ABFC} */
  35. DEFINE_GUID(IID_IDirectPlayLobby3A, 0x2db72491, 0x652c, 0x11d1, 0xa7, 0xa8, 0x0, 0x0, 0xf8, 0x3, 0xab, 0xfc);
  36. /* {2FE8F810-B2A5-11d0-A787-0000F803ABFC} */
  37. DEFINE_GUID(CLSID_DirectPlayLobby, 0x2fe8f810, 0xb2a5, 0x11d0, 0xa7, 0x87, 0x0, 0x0, 0xf8, 0x3, 0xab, 0xfc);
  38.  
  39.  
  40. /****************************************************************************
  41.  *
  42.  * IDirectPlayLobby Structures
  43.  *
  44.  * Various structures used to invoke DirectPlayLobby.
  45.  *
  46.  ****************************************************************************/
  47.  
  48. typedef struct IDirectPlayLobby     FAR *LPDIRECTPLAYLOBBY;
  49. typedef struct IDirectPlayLobby     FAR *LPDIRECTPLAYLOBBYA;
  50. typedef struct IDirectPlayLobby     IDirectPlayLobbyA;
  51.  
  52. typedef struct IDirectPlayLobby2    FAR *LPDIRECTPLAYLOBBY2;
  53. typedef struct IDirectPlayLobby2    FAR *LPDIRECTPLAYLOBBY2A;
  54. typedef struct IDirectPlayLobby2    IDirectPlayLobby2A;
  55.  
  56. typedef struct IDirectPlayLobby3    FAR *LPDIRECTPLAYLOBBY3;
  57. typedef struct IDirectPlayLobby3    FAR *LPDIRECTPLAYLOBBY3A;
  58. typedef struct IDirectPlayLobby3    IDirectPlayLobby3A;
  59.  
  60.  
  61. /*
  62.  * DPLAPPINFO
  63.  * Used to hold information about a registered DirectPlay
  64.  * application
  65.  */
  66. typedef struct DPLAPPINFO
  67. {
  68.     DWORD       dwSize;             // Size of this structure
  69.     GUID        guidApplication;    // GUID of the Application
  70.     union
  71.     {
  72.         LPSTR   lpszAppNameA;       // Pointer to the Application Name
  73.         LPWSTR  lpszAppName;
  74.     };
  75.  
  76. } DPLAPPINFO, FAR *LPDPLAPPINFO;
  77.  
  78. /*
  79.  * LPCDPLAPPINFO
  80.  * A constant pointer to DPLAPPINFO
  81.  */
  82. typedef const DPLAPPINFO FAR *LPCDPLAPPINFO;
  83.  
  84. /*
  85.  * DPCOMPOUNDADDRESSELEMENT
  86.  *
  87.  * An array of these is passed to CreateCompoundAddresses()
  88.  */
  89. typedef struct DPCOMPOUNDADDRESSELEMENT
  90. {
  91.     GUID                guidDataType;
  92.     DWORD               dwDataSize;
  93.     LPVOID                lpData;
  94. } DPCOMPOUNDADDRESSELEMENT, FAR *LPDPCOMPOUNDADDRESSELEMENT;
  95.  
  96. /*
  97.  * LPCDPCOMPOUNDADDRESSELEMENT
  98.  * A constant pointer to DPCOMPOUNDADDRESSELEMENT
  99.  */
  100. typedef const DPCOMPOUNDADDRESSELEMENT FAR *LPCDPCOMPOUNDADDRESSELEMENT;
  101.  
  102. /*
  103.  * LPDPAPPLICATIONDESC
  104.  * Used to register a DirectPlay application
  105.  */
  106. typedef struct DPAPPLICATIONDESC
  107. {
  108.     DWORD       dwSize;
  109.     DWORD       dwFlags;
  110.     union
  111.     {
  112.         LPSTR       lpszApplicationNameA;
  113.         LPWSTR      lpszApplicationName;
  114.     };
  115.     GUID        guidApplication;
  116.     union
  117.     {
  118.         LPSTR       lpszFilenameA;
  119.         LPWSTR      lpszFilename;
  120.     };
  121.     union
  122.     {
  123.         LPSTR       lpszCommandLineA;
  124.         LPWSTR      lpszCommandLine;
  125.     };
  126.     union
  127.     {
  128.         LPSTR       lpszPathA;
  129.         LPWSTR      lpszPath;
  130.     };
  131.     union
  132.     {
  133.         LPSTR       lpszCurrentDirectoryA;
  134.         LPWSTR      lpszCurrentDirectory;
  135.     };
  136.     LPSTR       lpszDescriptionA;
  137.     LPWSTR      lpszDescriptionW;
  138. } DPAPPLICATIONDESC, *LPDPAPPLICATIONDESC;
  139.  
  140. /*
  141.  * LPDPAPPLICATIONDESC2
  142.  * Used to register a DirectPlay application
  143.  */
  144. typedef struct DPAPPLICATIONDESC2
  145. {
  146.     DWORD       dwSize;
  147.     DWORD       dwFlags;
  148.     union
  149.     {
  150.         LPSTR       lpszApplicationNameA;
  151.         LPWSTR      lpszApplicationName;
  152.     };
  153.     GUID        guidApplication;
  154.     union
  155.     {
  156.         LPSTR       lpszFilenameA;
  157.         LPWSTR      lpszFilename;
  158.     };
  159.     union
  160.     {
  161.         LPSTR       lpszCommandLineA;
  162.         LPWSTR      lpszCommandLine;
  163.     };
  164.     union
  165.     {
  166.         LPSTR       lpszPathA;
  167.         LPWSTR      lpszPath;
  168.     };
  169.     union
  170.     {
  171.         LPSTR       lpszCurrentDirectoryA;
  172.         LPWSTR      lpszCurrentDirectory;
  173.     };
  174.     LPSTR       lpszDescriptionA;
  175.     LPWSTR      lpszDescriptionW;
  176.     union
  177.     {
  178.         LPSTR        lpszAppLauncherNameA;
  179.         LPWSTR      lpszAppLauncherName;
  180.     };
  181. } DPAPPLICATIONDESC2, *LPDPAPPLICATIONDESC2;
  182.  
  183.  
  184. /****************************************************************************
  185.  *
  186.  * Enumeration Method Callback Prototypes
  187.  *
  188.  ****************************************************************************/
  189.  
  190. /*
  191.  * Callback for EnumAddress()
  192.  */
  193. typedef BOOL (FAR PASCAL *LPDPENUMADDRESSCALLBACK)(
  194.     REFGUID         guidDataType,
  195.     DWORD           dwDataSize,
  196.     LPCVOID         lpData,
  197.     LPVOID          lpContext);
  198.  
  199. /*
  200.  * Callback for EnumAddressTypes()
  201.  */
  202. typedef BOOL (FAR PASCAL *LPDPLENUMADDRESSTYPESCALLBACK)(
  203.     REFGUID         guidDataType,
  204.     LPVOID          lpContext,
  205.     DWORD           dwFlags);
  206.  
  207. /*
  208.  * Callback for EnumLocalApplications()
  209.  */
  210. typedef BOOL (FAR PASCAL * LPDPLENUMLOCALAPPLICATIONSCALLBACK)(
  211.     LPCDPLAPPINFO   lpAppInfo,
  212.     LPVOID          lpContext,
  213.     DWORD           dwFlags);
  214.  
  215.  
  216. /****************************************************************************
  217.  *
  218.  * DirectPlayLobby API Prototypes
  219.  *
  220.  ****************************************************************************/
  221. #ifdef UNICODE
  222. #define DirectPlayLobbyCreate   DirectPlayLobbyCreateW
  223. #else
  224. #define DirectPlayLobbyCreate   DirectPlayLobbyCreateA
  225. #endif /* UNICODE */
  226.  
  227. extern HRESULT WINAPI DirectPlayLobbyCreateW(LPGUID, LPDIRECTPLAYLOBBY *, IUnknown *, LPVOID, DWORD );
  228. extern HRESULT WINAPI DirectPlayLobbyCreateA(LPGUID, LPDIRECTPLAYLOBBYA *, IUnknown *, LPVOID, DWORD );
  229.  
  230.  
  231. /****************************************************************************
  232.  *
  233.  * IDirectPlayLobby (and IDirectPlayLobbyA) Interface
  234.  *
  235.  ****************************************************************************/
  236. #undef INTERFACE
  237. #define INTERFACE IDirectPlayLobby
  238. DECLARE_INTERFACE_( IDirectPlayLobby, IUnknown )
  239. {
  240.     /*  IUnknown Methods    */
  241.     STDMETHOD(QueryInterface)       (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  242.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  243.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  244.  
  245.     /*  IDirectPlayLobby Methods    */
  246.     STDMETHOD(Connect)              (THIS_ DWORD, LPDIRECTPLAY2 *, IUnknown FAR *) PURE;
  247.     STDMETHOD(CreateAddress)        (THIS_ REFGUID, REFGUID, LPCVOID, DWORD, LPVOID, LPDWORD) PURE;
  248.     STDMETHOD(EnumAddress)          (THIS_ LPDPENUMADDRESSCALLBACK, LPCVOID, DWORD, LPVOID) PURE;
  249.     STDMETHOD(EnumAddressTypes)     (THIS_ LPDPLENUMADDRESSTYPESCALLBACK, REFGUID, LPVOID, DWORD) PURE;
  250.     STDMETHOD(EnumLocalApplications)(THIS_ LPDPLENUMLOCALAPPLICATIONSCALLBACK, LPVOID, DWORD) PURE;
  251.     STDMETHOD(GetConnectionSettings)(THIS_ DWORD, LPVOID, LPDWORD) PURE;
  252.     STDMETHOD(ReceiveLobbyMessage)  (THIS_ DWORD, DWORD, LPDWORD, LPVOID, LPDWORD) PURE;
  253.     STDMETHOD(RunApplication)       (THIS_ DWORD, LPDWORD, LPDPLCONNECTION, HANDLE) PURE;
  254.     STDMETHOD(SendLobbyMessage)     (THIS_ DWORD, DWORD, LPVOID, DWORD) PURE;
  255.     STDMETHOD(SetConnectionSettings)(THIS_ DWORD, DWORD, LPDPLCONNECTION) PURE;
  256.     STDMETHOD(SetLobbyMessageEvent) (THIS_ DWORD, DWORD, HANDLE) PURE;
  257.  
  258. };
  259.  
  260. /****************************************************************************
  261.  *
  262.  * IDirectPlayLobby2 (and IDirectPlayLobby2A) Interface
  263.  *
  264.  ****************************************************************************/
  265. #undef INTERFACE
  266. #define INTERFACE IDirectPlayLobby2
  267. DECLARE_INTERFACE_( IDirectPlayLobby2, IDirectPlayLobby )
  268. {
  269.     /*  IUnknown Methods    */
  270.     STDMETHOD(QueryInterface)       (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  271.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  272.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  273.  
  274.     /*  IDirectPlayLobby Methods    */
  275.     STDMETHOD(Connect)              (THIS_ DWORD, LPDIRECTPLAY2 *, IUnknown FAR *) PURE;
  276.     STDMETHOD(CreateAddress)        (THIS_ REFGUID, REFGUID, LPCVOID, DWORD, LPVOID, LPDWORD) PURE;
  277.     STDMETHOD(EnumAddress)          (THIS_ LPDPENUMADDRESSCALLBACK, LPCVOID, DWORD, LPVOID) PURE;
  278.     STDMETHOD(EnumAddressTypes)     (THIS_ LPDPLENUMADDRESSTYPESCALLBACK, REFGUID, LPVOID, DWORD) PURE;
  279.     STDMETHOD(EnumLocalApplications)(THIS_ LPDPLENUMLOCALAPPLICATIONSCALLBACK, LPVOID, DWORD) PURE;
  280.     STDMETHOD(GetConnectionSettings)(THIS_ DWORD, LPVOID, LPDWORD) PURE;
  281.     STDMETHOD(ReceiveLobbyMessage)  (THIS_ DWORD, DWORD, LPDWORD, LPVOID, LPDWORD) PURE;
  282.     STDMETHOD(RunApplication)       (THIS_ DWORD, LPDWORD, LPDPLCONNECTION, HANDLE) PURE;
  283.     STDMETHOD(SendLobbyMessage)     (THIS_ DWORD, DWORD, LPVOID, DWORD) PURE;
  284.     STDMETHOD(SetConnectionSettings)(THIS_ DWORD, DWORD, LPDPLCONNECTION) PURE;
  285.     STDMETHOD(SetLobbyMessageEvent) (THIS_ DWORD, DWORD, HANDLE) PURE;
  286.  
  287.     /*  IDirectPlayLobby2 Methods    */
  288.     STDMETHOD(CreateCompoundAddress)(THIS_ LPCDPCOMPOUNDADDRESSELEMENT,DWORD,LPVOID,LPDWORD) PURE;
  289. };
  290.  
  291. /****************************************************************************
  292.  *
  293.  * IDirectPlayLobby3 (and IDirectPlayLobby3A) Interface
  294.  *
  295.  ****************************************************************************/
  296. #undef INTERFACE
  297. #define INTERFACE IDirectPlayLobby3
  298. DECLARE_INTERFACE_( IDirectPlayLobby3, IDirectPlayLobby )
  299. {
  300.     /*  IUnknown Methods    */
  301.     STDMETHOD(QueryInterface)       (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  302.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  303.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  304.  
  305.     /*  IDirectPlayLobby Methods    */
  306.     STDMETHOD(Connect)              (THIS_ DWORD, LPDIRECTPLAY2 *, IUnknown FAR *) PURE;
  307.     STDMETHOD(CreateAddress)        (THIS_ REFGUID, REFGUID, LPCVOID, DWORD, LPVOID, LPDWORD) PURE;
  308.     STDMETHOD(EnumAddress)          (THIS_ LPDPENUMADDRESSCALLBACK, LPCVOID, DWORD, LPVOID) PURE;
  309.     STDMETHOD(EnumAddressTypes)     (THIS_ LPDPLENUMADDRESSTYPESCALLBACK, REFGUID, LPVOID, DWORD) PURE;
  310.     STDMETHOD(EnumLocalApplications)(THIS_ LPDPLENUMLOCALAPPLICATIONSCALLBACK, LPVOID, DWORD) PURE;
  311.     STDMETHOD(GetConnectionSettings)(THIS_ DWORD, LPVOID, LPDWORD) PURE;
  312.     STDMETHOD(ReceiveLobbyMessage)  (THIS_ DWORD, DWORD, LPDWORD, LPVOID, LPDWORD) PURE;
  313.     STDMETHOD(RunApplication)       (THIS_ DWORD, LPDWORD, LPDPLCONNECTION, HANDLE) PURE;
  314.     STDMETHOD(SendLobbyMessage)     (THIS_ DWORD, DWORD, LPVOID, DWORD) PURE;
  315.     STDMETHOD(SetConnectionSettings)(THIS_ DWORD, DWORD, LPDPLCONNECTION) PURE;
  316.     STDMETHOD(SetLobbyMessageEvent) (THIS_ DWORD, DWORD, HANDLE) PURE;
  317.  
  318.     /*  IDirectPlayLobby2 Methods    */
  319.     STDMETHOD(CreateCompoundAddress)(THIS_ LPCDPCOMPOUNDADDRESSELEMENT,DWORD,LPVOID,LPDWORD) PURE;
  320.  
  321.     /*  IDirectPlayLobby3 Methods    */
  322.     STDMETHOD(ConnectEx)            (THIS_ DWORD, REFIID, LPVOID *, IUnknown FAR *) PURE;
  323.     STDMETHOD(RegisterApplication)  (THIS_ DWORD, LPVOID) PURE;
  324.     STDMETHOD(UnregisterApplication)(THIS_ DWORD, REFGUID) PURE;
  325.     STDMETHOD(WaitForConnectionSettings)(THIS_ DWORD) PURE;
  326. };
  327.  
  328. /****************************************************************************
  329.  *
  330.  * IDirectPlayLobby interface macros
  331.  *
  332.  ****************************************************************************/
  333.  
  334. #if !defined(__cplusplus) || defined(CINTERFACE)
  335.  
  336. #define IDirectPlayLobby_QueryInterface(p,a,b)              (p)->lpVtbl->QueryInterface(p,a,b)
  337. #define IDirectPlayLobby_AddRef(p)                          (p)->lpVtbl->AddRef(p)
  338. #define IDirectPlayLobby_Release(p)                         (p)->lpVtbl->Release(p)
  339. #define IDirectPlayLobby_Connect(p,a,b,c)                   (p)->lpVtbl->Connect(p,a,b,c)
  340. #define IDirectPlayLobby_ConnectEx(p,a,b,c,d)               (p)->lpVtbl->ConnectEx(p,a,b,c,d)
  341. #define IDirectPlayLobby_CreateAddress(p,a,b,c,d,e,f)       (p)->lpVtbl->CreateAddress(p,a,b,c,d,e,f)
  342. #define IDirectPlayLobby_CreateCompoundAddress(p,a,b,c,d)   (p)->lpVtbl->CreateCompoundAddress(p,a,b,c,d)
  343. #define IDirectPlayLobby_EnumAddress(p,a,b,c,d)             (p)->lpVtbl->EnumAddress(p,a,b,c,d)
  344. #define IDirectPlayLobby_EnumAddressTypes(p,a,b,c,d)        (p)->lpVtbl->EnumAddressTypes(p,a,b,c,d)
  345. #define IDirectPlayLobby_EnumLocalApplications(p,a,b,c)     (p)->lpVtbl->EnumLocalApplications(p,a,b,c)
  346. #define IDirectPlayLobby_GetConnectionSettings(p,a,b,c)     (p)->lpVtbl->GetConnectionSettings(p,a,b,c)
  347. #define IDirectPlayLobby_ReceiveLobbyMessage(p,a,b,c,d,e)   (p)->lpVtbl->ReceiveLobbyMessage(p,a,b,c,d,e)
  348. #define IDirectPlayLobby_RegisterApplication(p,a,b)         (p)->lpVtbl->RegisterApplication(p,a,b)
  349. #define IDirectPlayLobby_RunApplication(p,a,b,c,d)          (p)->lpVtbl->RunApplication(p,a,b,c,d)
  350. #define IDirectPlayLobby_SendLobbyMessage(p,a,b,c,d)        (p)->lpVtbl->SendLobbyMessage(p,a,b,c,d)
  351. #define IDirectPlayLobby_SetConnectionSettings(p,a,b,c)        (p)->lpVtbl->SetConnectionSettings(p,a,b,c)
  352. #define IDirectPlayLobby_SetLobbyMessageEvent(p,a,b,c)        (p)->lpVtbl->SetLobbyMessageEvent(p,a,b,c)
  353. #define IDirectPlayLobby_UnregisterApplication(p,a,b)       (p)->lpVtbl->UnregisterApplication(p,a,b)
  354. #define IDirectPlayLobby_WaitForConnectionSettings(p,a)     (p)->lpVtbl->WaitForConnectionSettings(p,a)
  355.  
  356. #else /* C++ */
  357.  
  358. #define IDirectPlayLobby_QueryInterface(p,a,b)              (p)->QueryInterface(a,b)
  359. #define IDirectPlayLobby_AddRef(p)                          (p)->AddRef()
  360. #define IDirectPlayLobby_Release(p)                         (p)->Release()
  361. #define IDirectPlayLobby_Connect(p,a,b,c)                   (p)->Connect(a,b,c)
  362. #define IDirectPlayLobby_ConnectEx(p,a,b,c,d)               (p)->ConnectEx(a,b,c,d)
  363. #define IDirectPlayLobby_CreateAddress(p,a,b,c,d,e,f)       (p)->CreateAddress(a,b,c,d,e,f)
  364. #define IDirectPlayLobby_CreateCompoundAddress(p,a,b,c,d)   (p)->CreateCompoundAddress(a,b,c,d)
  365. #define IDirectPlayLobby_EnumAddress(p,a,b,c,d)             (p)->EnumAddress(a,b,c,d)
  366. #define IDirectPlayLobby_EnumAddressTypes(p,a,b,c,d)        (p)->EnumAddressTypes(a,b,c,d)
  367. #define IDirectPlayLobby_EnumLocalApplications(p,a,b,c)     (p)->EnumLocalApplications(a,b,c)
  368. #define IDirectPlayLobby_GetConnectionSettings(p,a,b,c)     (p)->GetConnectionSettings(a,b,c)
  369. #define IDirectPlayLobby_ReceiveLobbyMessage(p,a,b,c,d,e)   (p)->ReceiveLobbyMessage(a,b,c,d,e)
  370. #define IDirectPlayLobby_RegisterApplication(p,a,b)         (p)->RegisterApplication(a,b)
  371. #define IDirectPlayLobby_RunApplication(p,a,b,c,d)          (p)->RunApplication(a,b,c,d)
  372. #define IDirectPlayLobby_SendLobbyMessage(p,a,b,c,d)        (p)->SendLobbyMessage(a,b,c,d)
  373. #define IDirectPlayLobby_SetConnectionSettings(p,a,b,c)        (p)->SetConnectionSettings(a,b,c)
  374. #define IDirectPlayLobby_SetLobbyMessageEvent(p,a,b,c)        (p)->SetLobbyMessageEvent(a,b,c)
  375. #define IDirectPlayLobby_UnregisterApplication(p,a,b)       (p)->UnregisterApplication(a,b)
  376. #define IDirectPlayLobby_WaitForConnectionSettings(p,a)     (p)->WaitForConnectionSettings(a)
  377.  
  378. #endif
  379.  
  380. /****************************************************************************
  381.  *
  382.  * DirectPlayLobby Flags
  383.  *
  384.  ****************************************************************************/
  385.  
  386. /*
  387.  *    This flag is used by IDirectPlayLobby->WaitForConnectionSettings to
  388.  *    cancel a current wait that is in progress.
  389.  */
  390. #define DPLWAIT_CANCEL                  0x00000001
  391.  
  392.  
  393. /*
  394.  *    This is a message flag used by ReceiveLobbyMessage.  It can be
  395.  *    returned in the dwMessageFlags parameter to indicate a message from
  396.  *    the system.
  397.  */
  398. #define DPLMSG_SYSTEM                    0x00000001
  399.  
  400. /*
  401.  *    This is a message flag used by ReceiveLobbyMessage and SendLobbyMessage.
  402.  *  It is used to indicate that the message is a standard lobby message.
  403.  *  DPLMSG_SETPROPERTY, DPLMSG_SETPROPERTYRESPONSE, DPLMSG_GETPROPERTY,
  404.  *    DPLMSG_GETPROPERTYRESPONSE
  405.  */
  406. #define DPLMSG_STANDARD                    0x00000002
  407.  
  408.  
  409. /****************************************************************************
  410.  *
  411.  * DirectPlayLobby messages and message data structures
  412.  *
  413.  * All system messages have a dwMessageFlags value of DPLMSG_SYSTEM returned
  414.  * from a call to ReceiveLobbyMessage.
  415.  *
  416.  * All standard messages have a dwMessageFlags value of DPLMSG_STANDARD returned
  417.  * from a call to ReceiveLobbyMessage.
  418.  *
  419.  ****************************************************************************/
  420.  
  421. /*
  422.  * DPLMSG_GENERIC
  423.  * Generic message structure used to identify the message type.
  424.  */
  425. typedef struct _DPLMSG_GENERIC
  426. {
  427.     DWORD       dwType;         // Message type
  428. } DPLMSG_GENERIC, FAR *LPDPLMSG_GENERIC;
  429.  
  430. /*
  431.  * DPLMSG_SYSTEMMESSAGE
  432.  * Generic message format for all system messages --
  433.  * DPLSYS_CONNECTIONSETTINGSREAD, DPLSYS_DPLYCONNECTSUCCEEDED,
  434.  * DPLSYS_DPLAYCONNECTFAILED, DPLSYS_APPTERMINATED, DPLSYS_NEWCONNECTIONSETTINGS
  435.  */
  436. typedef struct _DPLMSG_SYSTEMMESSAGE
  437. {
  438.     DWORD       dwType;         // Message type
  439.     GUID        guidInstance;   // Instance GUID of the dplay session the message corresponds to
  440. } DPLMSG_SYSTEMMESSAGE, FAR *LPDPLMSG_SYSTEMMESSAGE;
  441.  
  442. /*
  443.  *  DPLMSG_SETPROPERTY
  444.  *  Standard message sent by an application to a lobby to set a
  445.  *  property
  446.  */
  447. typedef struct _DPLMSG_SETPROPERTY
  448. {
  449.     DWORD    dwType;                // Message type
  450.     DWORD    dwRequestID;        // Request ID (DPL_NOCONFIRMATION if no confirmation desired)
  451.     GUID    guidPlayer;            // Player GUID
  452.     GUID    guidPropertyTag;    // Property GUID
  453.     DWORD    dwDataSize;            // Size of data
  454.     DWORD    dwPropertyData[1];    // Buffer containing data
  455. } DPLMSG_SETPROPERTY, FAR *LPDPLMSG_SETPROPERTY;
  456.  
  457. #define    DPL_NOCONFIRMATION            0
  458.  
  459. /*
  460.  *  DPLMSG_SETPROPERTYRESPONSE
  461.  *  Standard message returned by a lobby to confirm a 
  462.  *  DPLMSG_SETPROPERTY message.
  463.  */
  464. typedef struct _DPLMSG_SETPROPERTYRESPONSE
  465. {
  466.     DWORD    dwType;                // Message type
  467.     DWORD    dwRequestID;        // Request ID
  468.     GUID    guidPlayer;            // Player GUID
  469.     GUID    guidPropertyTag;    // Property GUID
  470.     HRESULT    hr;                    // Return Code
  471. } DPLMSG_SETPROPERTYRESPONSE, FAR *LPDPLMSG_SETPROPERTYRESPONSE;
  472.  
  473. /*
  474.  *  DPLMSG_GETPROPERTY
  475.  *  Standard message sent by an application to a lobby to request
  476.  *    the current value of a property
  477.  */
  478. typedef struct _DPLMSG_GETPROPERTY
  479. {
  480.     DWORD    dwType;                // Message type
  481.     DWORD    dwRequestID;        // Request ID
  482.     GUID    guidPlayer;            // Player GUID
  483.     GUID    guidPropertyTag;    // Property GUID
  484. } DPLMSG_GETPROPERTY, FAR *LPDPLMSG_GETPROPERTY;
  485.  
  486. /*
  487.  *  DPLMSG_GETPROPERTYRESPONSE
  488.  *  Standard message returned by a lobby in response to a
  489.  *    DPLMSG_GETPROPERTY message.
  490.  */
  491. typedef struct _DPLMSG_GETPROPERTYRESPONSE
  492. {
  493.     DWORD    dwType;                // Message type
  494.     DWORD    dwRequestID;        // Request ID
  495.     GUID    guidPlayer;            // Player GUID
  496.     GUID    guidPropertyTag;    // Property GUID
  497.     HRESULT    hr;                    // Return Code
  498.     DWORD    dwDataSize;            // Size of data
  499.     DWORD    dwPropertyData[1];    // Buffer containing data
  500. } DPLMSG_GETPROPERTYRESPONSE, FAR *LPDPLMSG_GETPROPERTYRESPONSE;
  501.  
  502. /*
  503.  *  DPLMSG_NEWSESSIONHOST
  504.  *  Standard message returned by a lobby in response to a
  505.  *    the session host migrating to a new client
  506.  */
  507. typedef struct _DPLMSG_NEWSESSIONHOST
  508. {
  509.     DWORD   dwType;             // Message type
  510.     GUID    guidInstance;       // GUID Instance of the session
  511. } DPLMSG_NEWSESSIONHOST, FAR *LPDPLMSG_NEWSESSIONHOST;
  512.  
  513.  
  514. /******************************************
  515.  *
  516.  *    DirectPlay Lobby message dwType values
  517.  *
  518.  *****************************************/
  519.  
  520. /*
  521.  *  The application has read the connection settings.
  522.  *  It is now O.K. for the lobby client to release
  523.  *  its IDirectPlayLobby interface.
  524.  */
  525. #define DPLSYS_CONNECTIONSETTINGSREAD   0x00000001
  526.  
  527. /*
  528.  *  The application's call to DirectPlayConnect failed
  529.  */
  530. #define DPLSYS_DPLAYCONNECTFAILED       0x00000002
  531.  
  532. /*
  533.  *  The application has created a DirectPlay session.
  534.  */
  535. #define DPLSYS_DPLAYCONNECTSUCCEEDED    0x00000003
  536.  
  537. /*
  538.  *  The application has terminated.
  539.  */
  540. #define DPLSYS_APPTERMINATED            0x00000004
  541.  
  542. /*
  543.  *  The message is a DPLMSG_SETPROPERTY message.
  544.  */
  545. #define DPLSYS_SETPROPERTY                0x00000005
  546.  
  547. /*
  548.  *  The message is a DPLMSG_SETPROPERTYRESPONSE message.
  549.  */
  550. #define DPLSYS_SETPROPERTYRESPONSE        0x00000006
  551.  
  552. /*
  553.  *  The message is a DPLMSG_GETPROPERTY message.
  554.  */
  555. #define DPLSYS_GETPROPERTY                0x00000007
  556.  
  557. /*
  558.  *  The message is a DPLMSG_GETPROPERTYRESPONSE message.
  559.  */
  560. #define DPLSYS_GETPROPERTYRESPONSE        0x00000008
  561.  
  562. /*
  563.  *  The message is a DPLMSG_NEWSESSIONHOST message.
  564.  */
  565. #define DPLSYS_NEWSESSIONHOST           0x00000009
  566.  
  567. /*
  568.  *  New connection settings are available.
  569.  */
  570. #define DPLSYS_NEWCONNECTIONSETTINGS    0x0000000A
  571.  
  572.  
  573. /****************************************************************************
  574.  *
  575.  * DirectPlay defined property GUIDs and associated data structures
  576.  *
  577.  ****************************************************************************/
  578.  
  579. /*
  580.  * DPLPROPERTY_MessagesSupported
  581.  *
  582.  * Request whether the lobby supports standard.  Lobby with respond with either
  583.  * TRUE or FALSE or may not respond at all.
  584.  * 
  585.  * Property data is a single BOOL with TRUE or FALSE
  586.  */
  587. // {762CCDA1-D916-11d0-BA39-00C04FD7ED67}
  588. DEFINE_GUID(DPLPROPERTY_MessagesSupported, 
  589. 0x762ccda1, 0xd916, 0x11d0, 0xba, 0x39, 0x0, 0xc0, 0x4f, 0xd7, 0xed, 0x67);
  590.  
  591. /*
  592.  * DPLPROPERTY_LobbyGuid
  593.  *
  594.  * Request the GUID that identifies the lobby software that the application
  595.  * is communicating with.
  596.  *
  597.  * Property data is a single GUID.
  598.  */
  599. // {F56920A0-D218-11d0-BA39-00C04FD7ED67}
  600. DEFINE_GUID(DPLPROPERTY_LobbyGuid, 
  601. 0xf56920a0, 0xd218, 0x11d0, 0xba, 0x39, 0x0, 0xc0, 0x4f, 0xd7, 0xed, 0x67);
  602.  
  603. /*
  604.  * DPLPROPERTY_PlayerGuid
  605.  *
  606.  * Request the GUID that identifies the player on this machine for sending
  607.  * property data back to the lobby.
  608.  *
  609.  * Property data is the DPLDATA_PLAYERDATA structure
  610.  */
  611. // {B4319322-D20D-11d0-BA39-00C04FD7ED67}
  612. DEFINE_GUID(DPLPROPERTY_PlayerGuid, 
  613. 0xb4319322, 0xd20d, 0x11d0, 0xba, 0x39, 0x0, 0xc0, 0x4f, 0xd7, 0xed, 0x67);
  614.  
  615. /*
  616.  * DPLDATA_PLAYERGUID
  617.  *
  618.  * Data structure to hold the GUID of the player and player creation flags
  619.  * from the lobby.
  620.  */
  621. typedef struct _DPLDATA_PLAYERGUID
  622. {
  623.     GUID    guidPlayer;
  624.     DWORD    dwPlayerFlags;
  625. } DPLDATA_PLAYERGUID, FAR *LPDPLDATA_PLAYERGUID;
  626.  
  627. /*
  628.  * DPLPROPERTY_PlayerScore
  629.  *
  630.  * Used to send an array of long integers to the lobby indicating the 
  631.  * score of a player.
  632.  *
  633.  * Property data is the DPLDATA_PLAYERSCORE structure.
  634.  */
  635. // {48784000-D219-11d0-BA39-00C04FD7ED67}
  636. DEFINE_GUID(DPLPROPERTY_PlayerScore, 
  637. 0x48784000, 0xd219, 0x11d0, 0xba, 0x39, 0x0, 0xc0, 0x4f, 0xd7, 0xed, 0x67);
  638.  
  639. /*
  640.  * DPLDATA_PLAYERSCORE
  641.  *
  642.  * Data structure to hold an array of long integers representing a player score.
  643.  * Application must allocate enough memory to hold all the scores.
  644.  */
  645. typedef struct _DPLDATA_PLAYERSCORE
  646. {
  647.     DWORD    dwScoreCount;
  648.     LONG    Score[1];
  649. } DPLDATA_PLAYERSCORE, FAR *LPDPLDATA_PLAYERSCORE;
  650.  
  651. /****************************************************************************
  652.  *
  653.  * DirectPlay Address ID's
  654.  *
  655.  ****************************************************************************/
  656.  
  657. /* DirectPlay Address
  658.  *
  659.  * A DirectPlay address consists of multiple chunks of data, each tagged
  660.  * with a GUID signifying the type of data in the chunk. The chunk also
  661.  * has a length so that unknown chunk types can be skipped.
  662.  *
  663.  * The EnumAddress() function is used to parse these address data chunks.
  664.  */
  665.  
  666. /*
  667.  * DPADDRESS
  668.  *
  669.  * Header for block of address data elements
  670.  */
  671. typedef struct _DPADDRESS
  672. {
  673.     GUID                guidDataType;
  674.     DWORD               dwDataSize;
  675. } DPADDRESS;
  676.  
  677. typedef DPADDRESS FAR *LPDPADDRESS;
  678.  
  679. /*
  680.  * DPAID_TotalSize
  681.  *
  682.  * Chunk is a DWORD containing size of entire DPADDRESS structure
  683.  */
  684.  
  685. // {1318F560-912C-11d0-9DAA-00A0C90A43CB}
  686. DEFINE_GUID(DPAID_TotalSize, 
  687. 0x1318f560, 0x912c, 0x11d0, 0x9d, 0xaa, 0x0, 0xa0, 0xc9, 0xa, 0x43, 0xcb);
  688.  
  689. /*
  690.  * DPAID_ServiceProvider
  691.  *
  692.  * Chunk is a GUID describing the service provider that created the chunk.
  693.  * All addresses must contain this chunk.
  694.  */
  695.  
  696. // {07D916C0-E0AF-11cf-9C4E-00A0C905425E}
  697. DEFINE_GUID(DPAID_ServiceProvider, 
  698. 0x7d916c0, 0xe0af, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
  699.  
  700. /*
  701.  * DPAID_LobbyProvider
  702.  *
  703.  * Chunk is a GUID describing the lobby provider that created the chunk.
  704.  * All addresses must contain this chunk.
  705.  */
  706.  
  707. // {59B95640-9667-11d0-A77D-0000F803ABFC}
  708. DEFINE_GUID(DPAID_LobbyProvider, 
  709. 0x59b95640, 0x9667, 0x11d0, 0xa7, 0x7d, 0x0, 0x0, 0xf8, 0x3, 0xab, 0xfc);
  710.  
  711. /*
  712.  * DPAID_Phone and DPAID_PhoneW
  713.  *
  714.  * Chunk is a string containing a phone number (i.e. "1-800-555-1212")
  715.  * in ANSI or UNICODE format
  716.  */
  717.  
  718. // {78EC89A0-E0AF-11cf-9C4E-00A0C905425E}
  719. DEFINE_GUID(DPAID_Phone, 
  720. 0x78ec89a0, 0xe0af, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
  721.  
  722. // {BA5A7A70-9DBF-11d0-9CC1-00A0C905425E}
  723. DEFINE_GUID(DPAID_PhoneW, 
  724. 0xba5a7a70, 0x9dbf, 0x11d0, 0x9c, 0xc1, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
  725.  
  726. /*
  727.  * DPAID_Modem and DPAID_ModemW
  728.  *
  729.  * Chunk is a string containing a modem name registered with TAPI
  730.  * in ANSI or UNICODE format
  731.  */
  732.  
  733. // {F6DCC200-A2FE-11d0-9C4F-00A0C905425E}
  734. DEFINE_GUID(DPAID_Modem, 
  735. 0xf6dcc200, 0xa2fe, 0x11d0, 0x9c, 0x4f, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
  736.  
  737. // {01FD92E0-A2FF-11d0-9C4F-00A0C905425E}
  738. DEFINE_GUID(DPAID_ModemW, 
  739. 0x1fd92e0, 0xa2ff, 0x11d0, 0x9c, 0x4f, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
  740.  
  741. /*
  742.  * DPAID_Inet and DPAID_InetW
  743.  *
  744.  * Chunk is a string containing a TCP/IP host name or an IP address
  745.  * (i.e. "dplay.microsoft.com" or "137.55.100.173") in ANSI or UNICODE format
  746.  */
  747.  
  748. // {C4A54DA0-E0AF-11cf-9C4E-00A0C905425E}
  749. DEFINE_GUID(DPAID_INet, 
  750. 0xc4a54da0, 0xe0af, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
  751.  
  752. // {E63232A0-9DBF-11d0-9CC1-00A0C905425E}
  753. DEFINE_GUID(DPAID_INetW, 
  754. 0xe63232a0, 0x9dbf, 0x11d0, 0x9c, 0xc1, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
  755.  
  756. /*
  757.  * DPAID_InetPort
  758.  *
  759.  * Chunk is the port number used for creating the apps TCP and UDP sockets.
  760.  * WORD value (i.e. 47624).
  761.  */
  762.  
  763. // {E4524541-8EA5-11d1-8A96-006097B01411}
  764. DEFINE_GUID(DPAID_INetPort, 
  765. 0xe4524541, 0x8ea5, 0x11d1, 0x8a, 0x96, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11);
  766.  
  767. #ifdef BIGMESSAGEDEFENSE
  768. #endif
  769.  
  770. /*
  771.  * DPCOMPORTADDRESS
  772.  *
  773.  * Used to specify com port settings. The constants that define baud rate,
  774.  * stop bits and parity are defined in WINBASE.H. The constants for flow
  775.  * control are given below.
  776.  */
  777.  
  778. #define DPCPA_NOFLOW        0           // no flow control
  779. #define DPCPA_XONXOFFFLOW   1           // software flow control
  780. #define DPCPA_RTSFLOW       2           // hardware flow control with RTS
  781. #define DPCPA_DTRFLOW       3           // hardware flow control with DTR
  782. #define DPCPA_RTSDTRFLOW    4           // hardware flow control with RTS and DTR
  783.  
  784. typedef struct _DPCOMPORTADDRESS
  785. {
  786.     DWORD   dwComPort;                  // COM port to use (1-4)
  787.     DWORD   dwBaudRate;                 // baud rate (100-256k)
  788.     DWORD   dwStopBits;                 // no. stop bits (1-2)
  789.     DWORD   dwParity;                   // parity (none, odd, even, mark)
  790.     DWORD   dwFlowControl;              // flow control (none, xon/xoff, rts, dtr)
  791. } DPCOMPORTADDRESS;
  792.  
  793. typedef DPCOMPORTADDRESS FAR *LPDPCOMPORTADDRESS;
  794.  
  795. /*
  796.  * DPAID_ComPort
  797.  *
  798.  * Chunk contains a DPCOMPORTADDRESS structure defining the serial port.
  799.  */
  800.  
  801. // {F2F0CE00-E0AF-11cf-9C4E-00A0C905425E}
  802. DEFINE_GUID(DPAID_ComPort, 
  803. 0xf2f0ce00, 0xe0af, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
  804.  
  805. /****************************************************************************
  806.  *
  807.  *     dplobby 1.0 obsolete definitions
  808.  *    Included for compatibility only.
  809.  *
  810.  ****************************************************************************/
  811. #define DPLAD_SYSTEM          DPLMSG_SYSTEM
  812.  
  813.  
  814. #ifdef __cplusplus
  815. };
  816. #endif /* __cplusplus */
  817.  
  818. #pragma warning(default:4201)
  819.  
  820. #endif /* __DPLOBBY_INCLUDED__ */
  821.